<template>
  <div class="demo-dropdown-wrap">
    <a-dropdown-button @click="handleButtonClick">
      注销
      <template #overlay>
        <a-menu @click="handleMenuClick">
          <a-menu-item key="1">
            <UserOutlined />
            个人信息
          </a-menu-item>
        </a-menu>
      </template>
      <template #icon><UserOutlined /></template>
    </a-dropdown-button>
  </div>
</template>
<script>
import 'ant-design-vue/dist/antd.css';
import { UserOutlined, DownOutlined } from '@ant-design/icons-vue';
import router from "@/router";
import Cookies from "js-cookie";
export default {

  name:"Dropdown",

  components: {
    UserOutlined,
    DownOutlined,
  },

  setup() {
    const tiaozhuan=()=>{
      router.push("/login")
    }

    const handleButtonClick = e => {
      Cookies.remove('user')
      tiaozhuan()

    };

    const handleMenuClick = e => {
      console.log('click', e);
    };

    return {
      handleButtonClick,
      handleMenuClick,
      tiaozhuan
    };
  },

}


</script>